<template>
    <div class="audit-project-base-change-view">

      <el-form ref="elForm" :model="datas" size="small" label-width="130px">
        <el-form-item label="项目名称：">
          <div>{{datas.project_name}}</div>
        </el-form-item>

        <el-form-item label="项目负责人：">
          <template v-if="datas.project_before && datas.project_after">
            <span v-if="datas.project_before.project_person_in_charge_id == datas.project_after.project_person_in_charge_id">
              {{datas.project_before.project_person_in_charge}}
            </span>
            <span v-else style="color: red">
              {{datas.project_before.project_person_in_charge}} -> {{datas.project_after.project_person_in_charge}}
            </span>
          </template>
          <template v-else-if="datas.project_before">
            {{datas.project_before.project_person_in_charge}}
          </template>
        </el-form-item>

        <el-form-item label="计划开始时间：">
          <template v-if="datas.project_before && datas.project_after">
            <span v-if="datas.project_before.plan_start_time == datas.project_after.plan_start_time">
              {{dateFormat1('yyyy-mm-dd',datas.project_before.plan_start_time)}}
            </span>
            <span v-else style="color: red">
              {{dateFormat1('yyyy-mm-dd',datas.project_before.plan_start_time)}} -> {{dateFormat1('yyyy-mm-dd',datas.project_after.plan_start_time)}}
            </span>
          </template>
          <template v-else-if="datas.project_before">
            {{dateFormat1('yyyy-mm-dd',datas.project_before.plan_start_time)}}
          </template>
        </el-form-item>

        <el-form-item label="计划结束时间：">
          <template v-if="datas.project_before && datas.project_after">
            <span v-if="datas.project_before.plan_end_time == datas.project_after.plan_end_time">
              {{dateFormat1('yyyy-mm-dd',datas.project_before.plan_end_time)}}
            </span>
            <span v-else style="color: red">
              {{dateFormat1('yyyy-mm-dd',datas.project_before.plan_end_time)}} -> {{dateFormat1('yyyy-mm-dd',datas.project_after.plan_end_time)}}
            </span>
          </template>
          <template v-else-if="datas.project_before">
            {{dateFormat1('yyyy-mm-dd',datas.project_before.plan_end_time)}}
          </template>
        </el-form-item>

        <el-form-item label="项目工期（天）：">
          <template v-if="datas.project_before && datas.project_after">
            <span v-if="datas.project_before.duration == datas.project_after.duration">
              {{datas.project_before.duration}}
            </span>
            <span v-else style="color: red">
              {{datas.project_before.duration}} -> {{datas.project_after.duration}}
            </span>
          </template>
          <template v-else-if="datas.project_before">
            {{datas.project_before.duration}}
          </template>
        </el-form-item>

        <el-form-item label="变更原因：">
          <div>{{datas.reason}}</div>
        </el-form-item>

        <el-form-item label="备注：">
          <div>{{datas.description}}</div>
        </el-form-item>

        <el-form-item label="变更影响程度：">
          <div>{{datas.level}}</div>
        </el-form-item>

        <el-form-item label="变更影响描述：">
          <div>{{datas.change_describe}}</div>
        </el-form-item>

        <el-form-item label="附件：">
          <file-preview :file-list="datas.files ? datas.files : []" />
        </el-form-item>
      </el-form>

    </div>
</template>

<script>
    export default {
        name: "projectBaseChangeView",
        props:{
            datas:{
                type:Object,
                default:function () {
                    return{
                        project_before:{},
                        project_after:{}
                    }
                }
            }
        }
    }
</script>

<style scoped>

</style>
